//
//  HZ_play_CollectionViewCell.m
//  HZ_Beautiful_Music
//
//  Created by dllo on 16/4/8.
//  Copyright © 2016年 ui. All rights reserved.
//

#import "HZ_play_CollectionViewCell.h"
#import <UIImageView+WebCache.h>
#import <QuartzCore/QuartzCore.h>
@interface HZ_play_CollectionViewCell ()
@property (nonatomic, strong) UIImageView *image;
@property (nonatomic, strong) UILabel *Mlabel;
@property (nonatomic, strong) UILabel *namelabel;


@end
@implementation HZ_play_CollectionViewCell


-(instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
 
        self.backgroundColor = [UIColor whiteColor] ;
        
        
        self.image = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, self.bounds.size.height - 10, self.bounds.size.height - 10)];
        [_image.layer setCornerRadius:_image.bounds.size.width / 2];
        _image.layer.masksToBounds = YES;
        
        
        _image.backgroundColor = [UIColor whiteColor];
        [self addSubview:_image];
        self.Mlabel = [[UILabel alloc] initWithFrame:CGRectMake(self.bounds.size.height  , 0, 2 * self.bounds.size.width / 3  + 2 , self.bounds.size.height / 2)];
        
//        _Mlabel.backgroundColor = [UIColor whiteColor];
        [self addSubview:_Mlabel];
        self.namelabel = [[UILabel alloc] initWithFrame:CGRectMake(_Mlabel.frame.origin.x, self.bounds.size.height / 2 + 5, 2 * self.bounds.size.width / 3 + 2, self.bounds.size.height / 2 - 12)];
//        _namelabel.backgroundColor = [UIColor whiteColor];
        [self addSubview:_namelabel];
   
    }
    
    return self;
    
    
}


-(void)setModel:(HZ_play_hs_Model *)model{
    
    
    _model = model;
    if (model.picUrl) {
        [_image sd_setImageWithURL:[NSURL URLWithString:_model.picUrl]];
    } else {
        _image.image = [UIImage imageNamed:@"14-160329151I4406"];
    }
    
    
    _Mlabel.text = _model.name;
    _namelabel.text = _model.singerName;
    
    
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
